<include file="public@header" />
</head>
<body>
<style type="text/css">
	.aui_state_lock{
		top:50% !important;
		left: 50% !important;
		transform: translate(-50%,-50%);
	}
</style>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
	
			<li class="active" id="list"><a href="{:url('Wxmeeting/index')}">场地类型列表</a></li>
		
		<!-- 	<li><a href="{:url('order/addorder')}">添加</a></li> -->
			<!-- 	<li><a href="{:url('user/add')}">{:lang('ADMIN_USER_ADD')}</a></li> -->
		</ul>
		
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th width="1%">ID</th>
					<th >园区名</th>
					<th>场地类型</th>
					<th>图</th>
					<th >操作</th>
				</tr>
			</thead>
			<tbody>
				
				
				
				<foreach name="list" item="vo" key="k">
					<tr>
					    <if condition="$vo.id gt 0">
					    <input type="hidden" name="id" value="{$vo.id}">
					    </if>
						<td>{$vo.id}</td>
						<!-- <td> <?php echo get_customer_name($vo['id']); ?></td> -->
						<td>{:get_incubator_name($incubator_id)}</td>
						<td>{$vo.type_name}</td>

						<td> <if condition="$vo.id gt 0">
						<php>$img_url=cmf_get_image_preview_url($vo['img_url']);</php> 
							<a href="javascript:parent.imagePreviewDialog('{$img_url}');">
								<img src="{$img_url}" style="width:70px;display:block;"/>

							</a>
						<else/>
						 <php>$img_url=cmf_get_image_preview_url($vo['img']);</php> 
							<a href="javascript:parent.imagePreviewDialog('{$img_url}');">
								<img src="{$img_url}" style="width:70px;display:block;"/>

							</a>
						</if>
						   
						</td>
					

						<td>
					
				
							
						
						
							<a  href='{:url('edit_site_type',array('cate_id'=>$vo.site_type_id,'id'=>$vo.id))}'>编辑</a>
					
							<!-- <if condition="$vo['id'] eq 2">
							
							<a class='cancel_del' id="{$vo.id}">取消禁用</a>
							<else />
							
							<a class='del' id="{$vo.id}">禁用</a>
							</if> -->
							
						</td>
						

					</tr>
				</foreach>
			</tbody>
		</table>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
</body>
</html>
<script>
	$(function(){
		$(".pay_status").each(function(i){
			var pay_status = $(this).text();
			if(pay_status == "未支付"){
				//alert(222);
			 $(this).css("color","red");
		    }
		})
	
	
		stime="1";
		etime="2";
		cusname="1";
		spacname="2";
		commpany_name="3";
		salesman="2";
		if(spacname){
			$("input[name=space_name]").val(spacname);
		}
		if(salesman){
			$("input[name=salesname").val(salesman);
		}
		// if(cusname){
		// 	$("input[name=customer_name]").val(cusname);
		// }
		//alert(commpany_name);
		if(commpany_name){
			$("input[name=commpany_name]").val(commpany_name);
		}
		// if(stime){
		// 	$("input[name=start_time]").val(stime);
		// }
		// if(etime){
		// 	$("input[name=end_time]").val(etime);
		// }
	})
	$(".add_audit").click(function(){
		id=$(this).attr("id");
		$.post("{:url('Wxmeeting/get_pay_status')}",{apply_id:id},function(data,status){
			if(data){
				if(data == 1){
					if(confirm("未支付是否通过审核？")){
						$.post("{:url('Wxmeeting/add_audit')}",{id:id,cancel:1},function(data,status){

						alert('审核成功');	
				 	    //$("input[name=deposit_price]").val('0.00');
				 	    location.href="{:url('index')}";
				        })
					}
				}else{
					if(confirm("是否通过审核？")){
			          $.post("{:url('Wxmeeting/add_audit')}",{id:id,cancel:1},function(data,status){

				      alert('审核成功');	
				 	//$("input[name=deposit_price]").val('0.00');
				 	  location.href="{:url('index')}";
				      })
	             	}
				}
			}
				 	//$("input[name=deposit_price]").val('0.00');
				 //	location.href="{:url('index')}";
		})
		
		
	})	
	$(".add_cancel_audit").click(function(){
		     id=$(this).attr("id");

			if(confirm("是否确定此审核不通过？")){
				 var remark=prompt("请输入备注信息");
				 $.post("{:url('Wxmeeting/remark')}",{id:id,remark:remark},function(data,status){

			     })
				 $.post("{:url('Wxmeeting/add_audit')}",{id:id,cancel:2},function(data,status){

				 	// alert('禁止通过成功');	
				 	// var remark=prompt("请输入备注信息");
				 	// if (name!=null && name!="") {
				 	// 	document.write("你好，" + name + "！今天过得好吗？")
				 	// }
				 	// $.post("{:url('Wxmeeting/remark')}",{id:id,remark:remark},function(data,status){

				 	// })
				 	//$("input[name=deposit_price]").val('0.00');
				 	location.href="{:url('index')}";
				 })
			}
		
		   })	
	$(".edit").click(
	    function(){
	    if(confirm("确认要编辑吗")){
	    	    var id=$(this).attr("id");
	    	    $.post("{:url('edit_site_type')}",
	    		{id:id},
	    		function(data,status){

	    			location.href="{:url('index')}";
	    		});
	    }
		
		
	    }
	);
	$(".cancel_del").click(
	    function(){
	    if(confirm("确认要取消禁用吗")){
	    	    var id=$(this).attr("id");
	    	    $.post("{:url('forbade_staff')}",
	    		{id:id,cancel:2},
	    		function(data,status){

	    			location.href="{:url('index')}";
	    		});
	    }
		
		
	    }
	);


	

</script>